function int2char,number,characters

;+
; NAME:
;       INT2CHAR
;
; PURPOSE:
;       Simple function to convert an integer to a double-trimmed character string
;       padded out to the string length provided by 'characters'.
;
; CATEGORY:
;       
;
; CALLING SEQUENCE:
;      x = int2char(number,characters)
;
; INPUTS:
;       number - integer to be converted
;       characters - the length of the string to be returned, will be zero
;                    padded at the front if necessary
;
; OPTIONAL INPUTS:
;
; OUTPUTS:
;       a string
;
; RESTRICTIONS:
;
;
; PROCEDURE:
;
;
; EXAMPLE:
;
; MODIFICATION HISTORY:
;       Started by Rob Crain, Swinburne, 24-Jan-2011
;-


  format_string = '(I'+strtrim(string(characters,format='(I)'),2) + $
                  '.'+strtrim(string(characters,format='(I)'),2)+')'
  return,strtrim(string(number,format=format_string),2)

end
